#include "include/planesystem2.h"
#include <QtWidgets/QApplication>
#include <iostream>
#include "include/setting.h"
#include "include/client.h"
#include <locale>
#include "include/system.h"

using namespace std;


int main(int argc, char *argv[])
{   
    // 操作台不显示乱码
    std::locale::global(std::locale("zh_CN.UTF-8"));
    //初始化配置
    InitMysql();

    int num;
    for (;;) {
        cout << "选择你的系统" << endl;
        cout << "1. 用户应用" << endl;
        cout << "2. 管理系统" << endl;
        cout << "输出操作的序号：";
        cin >> num;
        if (num == 1) {
            // QT图像
            QApplication a(argc, argv);
            PlaneSystem2 w;
            w.show();
            return a.exec();
        }
        else if (num == 2) {
            // 管理系统
            System* sys = new System();
            sys->SystemMain();
            return 0;
        }
        else {
            cout << "序号不在选择范围内！重新选择：" << endl;
        }
    }
}

